<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8"/>
	<title>收益记录</title>
	<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
	<link rel="stylesheet" th:href="@{/css/mui.min.css}"/>
	<style type="text/css">
		body{
			font-size: 15px;
		}
		input{
			font-size: 15px;
		}
	</style>
</head>
<body class="mui-ios mui-ios-9 mui-ios-9-1" th:inline="text">
	<!-- <header class="mui-bar mui-bar-nav">
		<a id="back" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		<h1 id="title" class="mui-title">收益记录</h1>
	</header> -->
	<!--下拉刷新容器-->
	<div id="pullrefresh" class="mui-content mui-scroll-wrapper">
		<div class="mui-scroll">
			<!--数据列表-->
			<ul class="mui-table-view ">
				
			</ul>
		</div>
	</div>
<script th:src="@{/js/jquery-1.11.1.min.js}"></script>
<script th:src="@{/js/common.js}"></script>
<script th:src="@{/js/mui.min.js}"></script>
<script th:inline="javascript">
/*<![CDATA[*/
	mui.init({
		pullRefresh: {
			container: '#pullrefresh',
			down: {
				callback: pulldownRefresh
			},
			up: {
				contentrefresh: '正在加载...',
				callback: pullupRefresh
			}
		}
	});
	
	/**
	 * 下拉刷新具体业务实现
	 */
	function pulldownRefresh() {
		window.location.reload();
	}
	
	var page = 0;//默认首页
	var size = 20;//默认每页展示20条
	var payMode = [[${bmpAccount.payMode}]];
	
	/**
	 * 上拉加载具体业务实现
	 */
	function pullupRefresh() {
		
		$.post("/user/income",{payMode:payMode,page:page,size:size},function(data){
			if(data.code=='200'){
				$(".incomeContent").remove();
				var liHtml = "";
				$.each(data.data.content,function(index,e){
					liHtml+="<li class=\"mui-table-view-cell mui-collapse\">"+
								"<a class=\"mui-navigate-right\" href=\"#\">"+
									"<label>时间：</label>"+
									"<label>"+new Date(e.payTime).Format("yyyy-MM-dd hh:mm:ss")+"</label>"+
									"<label>&nbsp;金额：</label>"+
									"<label>"+e.amount+"</label>"+
								"</a>"+
								"<div class=\"mui-collapse-content\">"+
									"<form class=\"mui-input-group\">"+
										"<div class=\"mui-input-row\">"+
											"<label>日变动</label>"+
											"<input type=\"text\" placeholder=\""+e.dayChange+"%\" readonly=\"readonly\"/>"+
										"</div>"+
										"<div class=\"mui-input-row\">"+
											"<label>挖币时间</label>"+
											"<input type=\"text\" placeholder=\""+new Date(e.miningDate).Format("yyyy-MM-dd")+"\" readonly=\"readonly\"/>"+
										"</div>"+
						
										"<div class=\"mui-input-row\">"+
											"<label>钱包地址</label>"+
											"<input type=\"text\" placeholder=\""+e.walletAddr+"\" readonly=\"readonly\"/>"+
										"</div>"+
									"</form>"+
								"</div>"+
							"</li>";
					
					
				});
				
				$(".mui-table-view").append(liHtml);
				
				if(data.data.last){
					mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); //参数为true代表没有更多数据了。
				}else{
					mui('#pullrefresh').pullRefresh().endPullupToRefresh(false);
				}
				page++;
			}
		},'json');
	
	}
	mui.ready(function() {
		mui('#pullrefresh').pullRefresh().pullupLoading();
	});
/*]]>*/
</script>
</body>
</html>